package com.link_with_health.controller;

import com.link_with_health.common.Result;
import com.link_with_health.common.TokenMap;
import com.link_with_health.service.PrescriptionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;

@Controller
@RequestMapping("/api/prescription")
public class PrescriptionController {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    private final String AUTH_TOKEN = "Authorization";
    private TokenMap tokenMap = TokenMap.getInstance();


    @Resource(name="prescriptionService")
    PrescriptionService prescriptionService;

    @PostMapping("/findPrescriptionInfo")
    @ResponseBody
    public Result findPrescriptionInfo(@RequestBody Map<String,Object> json
            , HttpServletRequest request){
        String msg = "请求失败 ";
        String token = request.getHeader(AUTH_TOKEN);

        try {
            String method = String.valueOf(json.get("method"));



        } catch(Exception e){
            logger.error("[]");
        }

        return Result.fail(msg);
    }

}
